package com.kcsoft.welcome.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.kcsoft.welcome.pojo.Pfence;

import java.beans.ExceptionListener;
import java.util.ArrayList;
import java.util.List;

public class ExcelListener implements ReadListener {

    private List<Pfence> list = new ArrayList<>();

    @Override
    public void invoke(Object o, AnalysisContext analysisContext) {
        list.add((Pfence) o);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

    // 获取解析的数据列表
    public List<Pfence> getDataList() {
        return list;
    }
}
